package com.im.partchat.adapter.learn;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;

import com.im.partchat.R;
import com.im.partchat.adapter.base.XRecyclerViewAdapter;
import com.im.partchat.adapter.base.XViewHolder;
import com.im.partchat.bean.learn.Tab3New;

import java.util.List;

/**
 * Created by flyou on 2017/6/30.
 * VersionCode: 1
 * Desc:
 */

public class NewTab3FragmentAdapter extends XRecyclerViewAdapter<Tab3New> {
    private Context context;
    public NewTab3FragmentAdapter(Context context, @NonNull RecyclerView mRecyclerView, List<Tab3New> dataLists) {
        super(mRecyclerView, dataLists,R.layout.view_learn_tab3_item);
        this.context=context;
    }

    @Override
    protected void bindData(XViewHolder holder, Tab3New data, int position) {
        holder.setImageUrl(context, R.id.cover_image,data.getUrl(),R.drawable.img_rectangle_pic_default);
        holder.setText(R.id.tv_title,data.getTitle());
        holder.setText(R.id.tv_public_name,data.getSubInfo());
        holder.setText(R.id.tv_public_time,data.getDate());
        holder.setText(R.id.tv_joinNum,data.getCommentNo()+"");

    }
}
